        function SetRating(imgvar,starsCount)
            {


                var number = Math.round(starsCount);
                if(number != 0){
                    if(!$(imgvar).parent().find("span").hasClass("hidden"))
                        $(imgvar).parent().find("span").addClass("hidden");
                    if(!$(imgvar).hasClass("hidden")){
                        $(imgvar).removeClass("hidden");
                    }
                    $(imgvar).attr("src","../../images/rating/star"+number+".png");


                }else
				{
                    $(imgvar).addClass("hidden");
                    $(imgvar).parent().find("span").removeClass("hidden");
                }
            }

function a_click(clicked_item,id)
{

	switch (clicked_item)
	{
		case 1:

			if(document.getElementById("hotels"+id).style.display=="block"){

			document.getElementById("hotels"+id).style.display="none";
			document.getElementById('hotel_details_tab'+id).style.background="url(images/tab.png)";
			document.getElementById('hotel_details_tab'+id).style.opacity="0.4";
			document.getElementById('hotel_details_tab'+id).style.backgroundSize="100% 100%";
			document.getElementById('hotels_tb'+id).style.color="#fff";
			document.getElementById("tb_hotel_hidden"+id).value=0;
				}
				else
				{

			document.getElementById("hotels"+id).style.display="block";
			document.getElementById('hotel_details_tab'+id).style.background="url(images/tab_hover.png)";
			document.getElementById('hotel_details_tab'+id).style.opacity="1";
			document.getElementById('hotel_details_tab'+id).style.backgroundSize="100% 100%";
			document.getElementById('hotels_tb'+id).style.color="#000";
			document.getElementById("tb_hotel_hidden"+id).value=1;

				}

			document.getElementById("rooms"+id).style.display="none";
			document.getElementById("galery"+id).style.display="none";



			document.getElementById('room_details_tab'+id).style.background="url(images/tab.png)";
			document.getElementById('room_details_tab'+id).style.opacity="0.4";
			document.getElementById('room_details_tab'+id).style.backgroundSize="100% 100%";
			document.getElementById('room_tb'+id).style.color="#fff";

			document.getElementById('galery_tab'+id).style.background="url(images/tab.png)";
			document.getElementById('galery_tab'+id).style.opacity="0.4";
			document.getElementById('galery_tab'+id).style.backgroundSize="100% 100%";
			document.getElementById('galery_tb'+id).style.color="#fff";


			document.getElementById("tb_room_hidden"+id).value=0;
			document.getElementById("tb_galery_hidden"+id).value=0;





		break;

		case 2:

			document.getElementById("hotels"+id).style.display="none";

			if(document.getElementById("rooms"+id).style.display=="block")
			{
			document.getElementById("rooms"+id).style.display="none"
			document.getElementById('room_details_tab'+id).style.background="url(images/tab.png)";
			document.getElementById('room_details_tab'+id).style.opacity="0.4";
			document.getElementById('room_details_tab'+id).style.backgroundSize="100% 100%";
			document.getElementById('room_tb'+id).style.color="#fff";
				document.getElementById("tb_room_hidden"+id).value=0;
			}
			else
			{
				document.getElementById("rooms"+id).style.display="block"
			document.getElementById('room_details_tab'+id).style.background="url(images/tab_hover.png)";
			document.getElementById('room_details_tab'+id).style.opacity="1";
			document.getElementById('room_details_tab'+id).style.backgroundSize="100% 100%";
			document.getElementById('room_tb'+id).style.color="#000";
				document.getElementById("tb_room_hidden"+id).value=1;
			}

			document.getElementById("galery"+id).style.display="none";

			document.getElementById('hotel_details_tab'+id).style.background="url(images/tab.png)";
			document.getElementById('hotel_details_tab'+id).style.opacity="0.4";
			document.getElementById('hotel_details_tab'+id).style.backgroundSize="100% 100%";
			document.getElementById('hotels_tb'+id).style.color="#fff";

			document.getElementById('galery_tab'+id).style.background="url(images/tab.png)";
			document.getElementById('galery_tab'+id).style.opacity="0.4";
			document.getElementById('galery_tab'+id).style.backgroundSize="100% 100%";
			document.getElementById('galery_tb'+id).style.color="#fff";

			document.getElementById("tb_hotel_hidden"+id).value=0;

			document.getElementById("tb_galery_hidden"+id).value=0;
		break;

		default:
			document.getElementById("hotels"+id).style.display="none";
			document.getElementById("rooms"+id).style.display="none";

			if(document.getElementById("galery"+id).style.display=="block"){

				document.getElementById("galery"+id).style.display="none";
				document.getElementById('galery_tab'+id).style.background="url(images/tab.png)";
				document.getElementById('galery_tab'+id).style.opacity="0.4";
				document.getElementById('galery_tab'+id).style.backgroundSize="100% 100%";
				document.getElementById('galery_tb'+id).style.color="#fff";
				document.getElementById("tb_galery_hidden"+id).value=0;
			}
			else
			{
				document.getElementById("galery"+id).style.display="block";
				document.getElementById('galery_tab'+id).style.background="url(images/tab_hover.png)";
				document.getElementById('galery_tab'+id).style.opacity="1";
				document.getElementById('galery_tab'+id).style.backgroundSize="100% 100%";
				document.getElementById('galery_tb'+id).style.color="#000";
				document.getElementById("tb_galery_hidden"+id).value=1;

			}
			document.getElementById('hotel_details_tab'+id).style.background="url(images/tab.png)";
			document.getElementById('hotel_details_tab'+id).style.opacity="0.4";
			document.getElementById('hotel_details_tab'+id).style.backgroundSize="100% 100%";
			document.getElementById('hotels_tb'+id).style.color="#fff";

			document.getElementById('room_details_tab'+id).style.background="url(images/tab.png)";
			document.getElementById('room_details_tab'+id).style.opacity="0.4";
			document.getElementById('room_details_tab'+id).style.backgroundSize="100% 100%";
			document.getElementById('room_tb'+id).style.color="#fff";



			document.getElementById("tb_hotel_hidden"+id).value=0;
			document.getElementById("tb_room_hidden"+id).value=0;



	}


}


function a_hover(item_hovered,id)
{
	switch(item_hovered)
	{
		case 1:
			if(document.getElementById("tb_hotel_hidden"+id).value!=1)
			{
				document.getElementById("hotels_tb"+id).style.color="#000";
				document.getElementById("hotels_tb"+id).style.textDecoration="none";
				document.getElementById("hotels_tb"+id).style.fontWeight="bold";
				document.getElementById("hotels_tb"+id).style.fontFamily="Arial, Helvetica, sans-serif";
				document.getElementById("hotel_details_tab"+id).style.background="url(images/tab_hover.png)";
				document.getElementById("hotel_details_tab"+id).style.opacity="0.4";
				document.getElementById("hotel_details_tab"+id).style.backgroundSize="100% 100%";
				document.getElementById("hotel_details_tab"+id).style.padding="10px";
			}
		break;

		case 2:
			if(document.getElementById("tb_room_hidden"+id).value!=1)
			{
				document.getElementById("room_tb"+id).style.color="#000";
				document.getElementById("room_tb"+id).style.textDecoration="none";
				document.getElementById("room_tb"+id).style.fontWeight="bold";
				document.getElementById("room_tb"+id).style.fontFamily="Arial, Helvetica, sans-serif";
				document.getElementById("room_details_tab"+id).style.background="url(images/tab_hover.png)";
				document.getElementById("room_details_tab"+id).style.opacity="0.4";
				document.getElementById("room_details_tab"+id).style.backgroundSize="100% 100%";
				document.getElementById("room_details_tab"+id).style.padding="10px";
			}

		break;

		default:
			if(document.getElementById("tb_galery_hidden"+id).value!=1)
			{
				document.getElementById("galery_tb"+id).style.color="#000";
				document.getElementById("galery_tb"+id).style.textDecoration="none";
				document.getElementById("galery_tb"+id).style.fontWeight="bold";
				document.getElementById("galery_tb"+id).style.fontFamily="Arial, Helvetica, sans-serif";
				document.getElementById("galery_tab"+id).style.background="url(images/tab_hover.png)";
				document.getElementById("galery_tab"+id).style.opacity="0.4";
				document.getElementById("galery_tab"+id).style.backgroundSize="100% 100%";
				document.getElementById("galery_tab"+id).style.padding="10px";
			}
	}
}


function a_mouseout(item_mouseout,id)
{
	switch(item_mouseout)
	{
		case 1:
			if(document.getElementById("tb_hotel_hidden"+id).value!=1)
			{
				document.getElementById("hotels_tb"+id).style.color="#fff";
				document.getElementById("hotels_tb"+id).style.textDecoration="none";
				document.getElementById("hotels_tb"+id).style.fontWeight="bold";
				document.getElementById("hotels_tb"+id).style.fontFamily="Arial, Helvetica, sans-serif";

				document.getElementById("hotel_details_tab"+id).style.background="url(images/tab.png)";
				document.getElementById("hotel_details_tab"+id).style.opacity="0.4";
				document.getElementById("hotel_details_tab"+id).style.backgroundSize="100% 100%";
				document.getElementById("hotel_details_tab"+id).style.padding="10px";
			}
		break;

		case 2:
			if(document.getElementById("tb_room_hidden"+id).value!=1)
			{
			document.getElementById("room_tb"+id).style.color="#fff";
			document.getElementById("room_tb"+id).style.textDecoration="none";
			document.getElementById("room_tb"+id).style.fontWeight="bold";
			document.getElementById("room_tb"+id).style.fontFamily="Arial, Helvetica, sans-serif";

			document.getElementById("room_details_tab"+id).style.background="url(images/tab.png)";
			document.getElementById("room_details_tab"+id).style.opacity="0.4";
			document.getElementById("room_details_tab"+id).style.backgroundSize="100% 100%";
			document.getElementById("room_details_tab"+id).style.padding="10px";
			}
		break;

		default:

			if(document.getElementById("tb_galery_hidden"+id).value!=1)
			{
				document.getElementById("galery_tb"+id).style.color="#fff";
				document.getElementById("galery_tb"+id).style.textDecoration="none";
				document.getElementById("galery_tb"+id).style.fontWeight="bold";
				document.getElementById("galery_tb"+id).style.fontFamily="Arial, Helvetica, sans-serif";

				document.getElementById("galery_tab"+id).style.background="url(images/tab.png)";
				document.getElementById("galery_tab"+id).style.opacity="0.4";
				document.getElementById("galery_tab"+id).style.backgroundSize="100% 100%";
				document.getElementById("galery_tab"+id).style.padding="10px";
			}
	}
}

////////////////////////////////////////////////////////

//Galery
function show_picture(index,hotelid)
{

for(i=0;i<document.getElementById('picture_number'+hotelid).value;i++)
{

	if(i!=index)
	{
		document.getElementById('picture'+hotelid+i).style.display="none";

	}
	else
	{

                var width=document.getElementById('picture'+hotelid+i).width;
                var height=document.getElementById('picture'+hotelid+i).height;
                var ratio=width/height;


/*                    alert(width+" "+height);*/
 /*                   alert(ratio+" "+500/300);*/
                    if(ratio<500/300)
                    {
                        document.getElementById('picture'+hotelid+i).height=300;
                    }
                        else
                    {
                        document.getElementById('picture'+hotelid+i).width=500;
                    }
               document.getElementById('picture'+hotelid+i).style.display="block";
	}


}

}

function showCancelationPolicy(id)
{
    
    if(document.getElementById(id).style.display=="block")    
     {
        document.getElementById(id).style.display="none";
     }
    else
    {    
        document.getElementById(id).style.display="block";
    }
}